package br.com.mftc.efitness.basicas;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

@Entity
@Table(name = "alunos")
@PrimaryKeyJoinColumn(name = "codigo")
public class Aluno extends UsuarioDoSistema implements Serializable {

	private static final long serialVersionUID = 6031521861506147642L;

	@Transient
	public static final int TAMANHO_MAX_CPF = 11;

	@Temporal(TemporalType.DATE)
	@Column(name = "data_de_nascimento", nullable = false)
	private Date dataDeNascimento;

	@Column(length = TAMANHO_MAX_CPF, unique = true)
	private String cpf;

	@Embedded
	private Rg rg;

	@Embedded
	private Endereco endereco;

	public Date getDataDeNascimento() {
		return dataDeNascimento;
	}

	public void setDataDeNascimento(Date dataDeNascimento) {
		this.dataDeNascimento = dataDeNascimento;
	}

	public String getCpf() {
		return cpf;
	}

	public void setCpf(String cpf) {
		this.cpf = cpf;
	}

	public Rg getRg() {
		return rg;
	}

	public void setRg(Rg rg) {
		this.rg = rg;
	}

	public Endereco getEndereco() {
		return endereco;
	}

	public void setEndereco(Endereco endereco) {
		this.endereco = endereco;
	}
}
